$.extend(String.prototype, {
    /**
     * 名称：replaceAll        属于:String
     * 描述：字符串替换方法。替换所有
     * @param regText
     * @param replaceText
     * @return
     */
    replaceAll: function (raRegExp, replaceText) {
        if (typeof raRegExp == "undefined" || raRegExp == null)
            return;
        if (!( raRegExp instanceof RegExp))
            raRegExp = new RegExp(raRegExp, "g");
        return this.replace(raRegExp, replaceText);
    },
    trim: (function () {
        var trimRe = /^\s+|\s+$/g;
        return function () {
            return String(this).replace(trimRe, "");
        }
    })()
});
$.extend(String, {
    addZeroLeft: function (value, resultLength) {
        var result = value.toString();
        if (result.length < resultLength) {
            var i = result.length;
            while (i++ < resultLength) {
                result = "0" + result;
                if (result.length == resultLength)
                    break;
            }
        }
        return result;
    }
});